﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NoMiddleman.Core.Domain;

namespace NoMiddleman.Core.Strategies
{
    public class SaleCostCalculator : ICostCalculator
    {
        public decimal CalculateCost(Advert advert)
        {
            Sale sale = advert as Sale;
            if (sale == null) throw new NullReferenceException();
            if (advert.Client.IsRegularClient())
                return sale.Price * 0.003M;
            return sale.Price*0.0035M;
        }
    }
}
